/**
 * 文件驱动器
 * @version 1.0.1
 */
class FsDriver {
    save(key, value) {
        uni.setStorageSync(key, value);
    }
	
    get(key, defaultValue = null) {
        return uni.getStorageSync(key) || defaultValue;
    }
	
	remove(key){
		uni.removeStorageSync(key);
	}

    saveJSON(key, jsonValue) {
        uni.setStorageSync(key, JSON.stringify(jsonValue));
    }

    getJSON(key, defaultValue = null) {
        return JSON.parse(uni.getStorageSync(key)) || defaultValue;
    }
}

export default FsDriver;